{% extends "base-layout.html" %}
{% block head_title %}
    {{ super() }}
{% endblock %}
{% block head_seo %}
    {{ super() }}
{% endblock %}
{% block head_link %}
    {{ super() }}
    <link href="/static/libs/selectpicker/css/bootstrap-select.min.css" rel="stylesheet" type="text/css" />
    <link href="/static/libs/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet" type="text/css" />
    <link href="/static/libs/jquery-growl/jquery.growl.css" rel="stylesheet" type="text/css" />
    <!-- <link href="/static/css/simplemde/normalize.css" rel="stylesheet" type="text/css" /> -->
    <link href="/static/css/simplemde/stylesheet.css" rel="stylesheet" type="text/css" />
    <link href="/static/libs/github-markdown-css/github-markdown.min.css" rel="stylesheet" type="text/css" />
    <link href="/static/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="/static/libs/prism/prism.css" rel="stylesheet" type="text/css" />
    <link href="/static/libs/simplemde/simplemde.min.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/edit.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/top-nav.css" rel="stylesheet" type="text/css" />
{% endblock %}
{% block head_css %}
    {{ super() }}
    <style type="text/css">
        .navbar.navbar-static-top {
            z-index: 8;
        }
    </style>
{% endblock %}
{% block head_js %}
    {{ super() }}
{% endblock %}
{% block body_header %}
    {{ super() }}
    {% include "widgets/top-nav.html" ignore missing with context %}
{% endblock %}
{% block body_main %}
    <div class="container">
        <div class="row">
            <div class="col-xs-12 col-md-10">
                <div role="form">
                    <div class="form-group">
                        <label for="txt-title">标题:</label>
                        <input type="text" class="form-control" id="txt-title" placeholder="标题" />
                    </div>
                    <div class="form-group">
                        <label for="editor-area">内容:</label>
                        <textarea id="editor-area"></textarea>
                    </div>
                    <div class="form-group">
                        <label for="txt-sketch">简述:</label>
                        <textarea class="form-control" id="txt-sketch" placeholder="简述(选填, 默认为内容前150字)" rows="3"></textarea>
                    </div>
                    <div class="form-group">
                        <label for="sel-category">分类:</label>
                        <select id="sel-category">
                            {% for category in categories %}
                            <option value="{{ category.name }}">{{ category.text }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="txt-tags">标签:<small>(最多10个标签, 单个标签最长15个字符)</small></label>
                        <input type="text" class="form-control" id="txt-tags" placeholder="标签" />
                    </div>
                </div>
                <div class="text-right">
                    <button type="button" id="btn-save" class="btn btn-default">保存</button>
                </div>
            </div>
        </div>
    </div>
    <!-- <iframe class="frame-editor" src="/editor" frameborder="0" scrolling="auto" allowfullscreen></iframe> -->
{% endblock %}
{% block body_src %}
    {{ super() }}
    <script type="text/javascript">
        GLOBAL.SAVE_URL = "{{ url_for('ajax_save', _suffix='/') }}";
        {% if blog_item is defined %}
        GLOBAL.BLOG_ITEM = {{ blog_item | tojson(ensure_ascii=False) | safe }};
        {% endif %}
    </script>
    <script src="/static/libs/selectpicker/js/bootstrap-select.min.js" type="text/javascript"></script>
    <script src="/static/libs/selectpicker/js/i18n/defaults-zh_CN.min.js" type="text/javascript"></script>
    <script src="/static/libs/typeahead.js/typeahead.bundle.min.js" type="text/javascript"></script>
    <script src="/static/libs/bootstrap-tagsinput/bootstrap-tagsinput.min.js" type="text/javascript"></script>
    <script src="/static/libs/jquery-growl/jquery.growl.js" type="text/javascript"></script>
    <script src="/static/libs/prism/prism.js" type="text/javascript"></script>
    <script src="/static/libs/simplemde/simplemde.min.js" type="text/javascript"></script>
    <script src="/static/js/edit.js" type="text/javascript"></script>
{% endblock %}
{% block body_js %}
    {{ super() }}
{% endblock %}
